<!DOCTYPE html>
<html lang="cn">
<head>
	<meta charset="UTF-8">
	<title>出行旅游</title>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" href="css/child.css">
	<link rel="stylesheet" href="css/MomPhotoDetail.css" />
	<link rel="stylesheet" href="css/upWindow.css" />
	<link rel="stylesheet" type="text/css" href="css/base.css" />
	<link rel="stylesheet" type="text/css" href="css/style.css" />
    <script src="bootstrap/js/jquery1.11.3.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script><!--平面轮播-->
	<!--<script src="js/ZoomPic.js"></script>-->
    <script type="text/javascript" src="js/register.js"></script>
    <script type="text/javascript" src="js/topPublic.js"></script>
</head>
<body>
<!--<a href="#top" hidden></a>-->
<script type="text/javascript" src="js/header.js" ></script>
<div style="background-color: #f7f7f7;">
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span12">
                <img  src="img/2016-06-12_173820.jpg"  style="width: 100%;margin-bottom: 30px;min-width:1178px;"/>
            </div>
        </div>

        <div class="row-fluid">
            <div class="head-main">
                <div class="row-fluid">
                    <div class="fl" style="width: 285px;">
                        <div class="accordion" id="accordion-190303">
                            <div class="accordion-group">
                                <div class="accordion-heading">
                                    <div class="accordion-toggle child-1" style=" padding-bottom: 20px;padding-top: 20px;margin-bottom: 10px;" data-toggle="collapse" data-parent="#accordion-190303" href="#accordion-element-71038">美国服务 <span style="font-size: 14px;">/ USA Service</span></div>
                                </div>
                                <div id="accordion-element-71038" class="accordion-body in collapse">
                                    <div class="accordion-inner child-package" mid='1' onclick="window.location.href='America.html'">饮食服务<span class="child-package-r">></span>
                                    </div>
                                    <div class="accordion-inner child-package child-flow" mid='2' onclick="window.location.href='americatravel.html'">出行旅游<span class="child-package-r">></span>
                                    </div>
                                    <div class="accordion-inner child-package " mid='3' onclick="window.location.href='americachan.html'">产检服务<span class="child-package-r">></span>
                                    </div>
                                    <div class="accordion-inner child-package " mid='4' onclick="window.location.href='americayue.html'">月子服务<span class="child-package-r">></span>
                                    </div>
                                    <div class="accordion-inner child-package " mid='5' onclick="window.location.href='americazheng.html'">办证服务<span class="child-package-r">></span>
                                    </div>
                                    <div class="accordion-inner child-package " mid='6' onclick="window.location.href='americacamera.html'">儿童摄影<span class="child-package-r">></span>
                                    </div>
                                </div>
                            </div>

                            <div class="accordion-group">
                                <div class="accordion-heading">
                                    <div class="accordion-toggle collapsed child-2" style=" padding-bottom: 20px;padding-top: 20px;margin-bottom: 10px;" data-toggle="collapse" onclick="window.open('http://tb.53kf.com/code/client/10130038/1][img]http://tb.53kf.com/kfimg.php?arg=10130038&style=1[/img]','_blank','height=500,width=750,top=220,left=500')">在线咨询</div>
                                </div>
                            </div>
                            <div class="accordion-group">
                                <div class="accordion-heading">
                                    <a href="child.html"><div class="accordion-toggle collapsed child-3" style=" padding-bottom: 20px;padding-top: 20px;margin-bottom: 10px;" onclick="window.location.href='child.html'">套餐参考</div></a>
                                </div>
                            </div>
                        </div>
                        <div>
                            <div class="child-contact">联系我们 <span style="font-size: 14px;color: #ccc;">/Contact Us</span></div>
                            <p class="top-line" ></p>
                            <div><img src="img/2016-06-07_140314.png" style="width:285px;height:120px;margin-top:10px;margin-bottom:20px;"></div>
                            <div class="child-name">南京圣嘉尔</div>
                            <div class="child-add">地址：南京市秦淮区汉中路</div>
                            <div class="child-add">89号金鹰国际商城24层C3</div>
                            <div class="child-add">电话：400-163-0766</div>
                            <div class="child-add">手机：18625170088</div>
                            <div class="child-add">QQ：2199207469</div>
                        </div>
                    </div>
<!------出行旅游------>                	
                	<div class="fl mids mainwidth" id="mid2">
                        <div class="flow-title">出行旅游</div><span class="fl" style="border: 3px solid #eb6100;width:99px;margin-bottom: 20px;"></span><span class="fr" style="border-bottom:2px solid #EBEBEB;width:755px;height:2px;"></span>
                       	<div id="mbjyjjDiv2"></div>
                       	<div class="add-comments">
							<div class="word-limit">
								<span id="counter" class="span1">0</span>
								<span>/</span>
								<span>300</span>
							</div>
							<textarea maxlength="300" class="mes" id="status" name="status" rows="6" cols="40"  placeholder="看到槽点，不吐不快！别憋着，马上大声说出来吧！"></textarea>
							<span class="addcomm" onclick="publishcomm()">发表评论</span>
							<ul class="all-comments">
								<li class="comm-list no-pad">
									<span class="comm-list-title2 comm-list-title-che" id="one2" onclick="submitcomm('a6b1293f6b62451198830ab613ae5164')">全部评论<span class="totalRowNumber totalRowNumber1"></span></span>
									<span class="comm-list-title2" id="two2" onclick="submitmycomm('a6b1293f6b62451198830ab613ae5164')">我的评论<span class="totalRowNumber totalRowNumber2"></span></span>
								</li>
								<ul class="all-comments-one" id="all-comments-one2">
									<div class="commbox"></div>
								</ul>
							</ul>
						</div>
                    </div>
                </div>
            </div>
            
        </div>
    	
    	
    </div>
</div>
<input type="hidden" value="america" id="navid" />
<script type="text/javascript" src="js/footer.js" ></script>
<script src="js/banner.js"></script>

<script type="text/javascript">
	$(document).ready(function(){
		submitBlock();
		submitcomm('a6b1293f6b62451198830ab613ae5164');
	})
//	饮食、出行
	function submitBlock(tubes) {
		$.ajax({
			url: '/baby/usaBabyMonth/queryMenuUsaBabyMonth',
			data: {
				menutype : 'a6b1293f6b62451198830ab613ae5164'
			},
			type: 'post',
			cache: false,
			dataType: 'json',
			success: function(data) {
				if(data.code == "2000") {
					var sid = '';
					var datalist = data.data;
					$("#mbjyjjDiv2").text('');
					$(".detimgbox").text('');
					var title = '';
					var detail = '';
					var str = '';
					if(datalist.length<=3){
						$("#tog").hide();
					}
					for(var i = 0; i < datalist.length; i++) {
				
						detail = datalist[i].introduce;
						sid = datalist[i].sid;
						str += '<div class="usa-desc">' + detail + '</div>' +
							'</div>' +
							'<div class="clear"></div>' +
							'</div>';
					
					}
			$("#mbjyjjDiv2").append(str);
						
//					$(".details").on("click", function(event) {})
					console.log(datalist);
				}
				
			},
			error: function() {
//				alert("异常")
			}
		})
	}
//(2)发表评论
		function publishcomm(){
			var commentMsg = $("#status").val();
			if(commentMsg==''){
		    	alert("请填写评论内容");
		      	return 
		    }
			$.ajax({
				url: '/baby/comment/addComment',
				data: {
					contentId:'a6b1293f6b62451198830ab613ae5164',
					commentMsg:commentMsg
				},
				type: 'post',
				cache: false,
				dataType: 'json',
				success: function(data) {
					console.log(data);
					if(data.code == "2000"){
						alert(data.message);  //评论成功提示语
						$("#status").val("");
						submitcomm('a6b1293f6b62451198830ab613ae5164');
					}else if(data.code == "5001"){
						$('.theme-popover-mask').show();
						$('.theme-popover-mask').height($(document).height());
						$('.theme-popover').slideDown(200);
					}
				}
			})
		}
////////所有评论////////
	function submitcomm(id){
		//var sid = $("#sid").val();
		$.ajax({
			url: '/baby/comment/queryComment',
			data: {
				key : id
			},
			type: 'post',
			cache: false,
			dataType: 'json',
			success: function(data) {
				if(data.code == "2000") {
					$(".commbox").text('');
					$(".totalRowNumber1").text('');
					$(".totalRowNumber2").text('');
					try{
						var datalist = data.data.dataList;
						var userName = '';
						var commentMsg = '';
						var str = '';
						var time = '';
						var totalRowNumber = '&nbsp;&nbsp;('+ data.data.totalRowNumber +')&nbsp;&nbsp;';
						for(i = 0; i < datalist.length; i++) {
							var img = datalist[i].user.realPicUrl;
							commentMsg = datalist[i].commentMsg;
							userName = datalist[i].user.userName;
							time = datalist[i].commentCreateTime;
							str = 	'<li class="comm-list">'+	
										'<img src="'+ img+'" />'+
										'<div class="comm-list-text">'+
											'<span style="color: #656565;font-weight: bold;">'+userName+'</span>'+
											'<span style="color: #b7b7b7;margin-left: 10px;">'+time+'</span>'+
											'<p class="word-break" id="commentMsg" style="color: #656565;line-height: 20px;margin-top: 8px;">'+commentMsg+'</p>'+
										'</div>'+
									'</li>';
							$(".commbox").append(str);
						}
						$(".totalRowNumber1").append(totalRowNumber);
						console.log(data);
					}catch(e){
						//TODO handle the exception
					}
				}
			},
			error: function(data) {
				console.log("服务请求的人太多"+data);
			}
		})
	}
////////我的评论////////
	function submitmycomm(sid){
		$.ajax({
			url: '/baby/comment/getComment',
			data: {
				key : sid
			},
			type: 'post',
			cache: false,
			dataType: 'json',
			success: function(data) {
				if(data.code == "2000") {
					$(".commbox").text('');
					$(".totalRowNumber2").text('');
					$(".totalRowNumber1").text('');
					var datalist = data.data.dataList;
					var userName = '';
					var commentMsg = '';
					var str = '';
					var time = '';
					var totalRowNumber = '&nbsp;&nbsp;('+ data.data.totalRowNumber +')&nbsp;&nbsp;';
					var userId = '';
					var img;
					for(i = 0; i < datalist.length; i++) {
						try{
							var img = datalist[i].user.realPicUrl;
							commentMsg = datalist[i].commentMsg;
							userName = datalist[i].user.userName;
							time = datalist[i].commentCreateTime;
							userId = datalist[i].userId;
							str = 	'<li class="comm-list">'+	
										'<img src="'+ img+'" />'+
										'<div class="comm-list-text">'+
											'<span style="color: #656565;font-weight: bold;">'+userName+'</span>'+
											'<span style="color: #b7b7b7;margin-left: 10px;">'+time+'</span>'+
											'<p class="word-break" id="commentMsg" style="color: #656565;line-height: 20px;margin-top: 8px;">'+commentMsg+'</p>'+
										'</div>'+
									'</li>';
						$(".commbox").append(str);
						}catch(e){
							//TODO handle the exception
						}
					}
					$(".totalRowNumber2").append(totalRowNumber);
					console.log(data);
				}else if(data.code == "5001"){
					$('.theme-popover-mask').show();
					$('.theme-popover-mask').height($(document).height());
					$('.theme-popover').slideDown(200);
				}
			},
			error: function(data) {
				console.log("服务请求的人太多"+data);
			}
		})
	}

//留言板字数
	document.getElementById("status").addEventListener('input',function(e){
		var len = document.getElementById("status").value.length;
		document.getElementById("counter").innerHTML = len
	})

</script>
</body>
</html>